﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace coffeeshop.AppCore
{
    public partial class ButtonEx : System.Windows.Forms.Button
    {
        //private System.Resources.ResourceManager mv_Resources = new System.Resources.ResourceManager("coffeeshop.Properties.Resources", System.Reflection.Assembly.GetExecutingAssembly());

        public Boolean isVisible { get; set; }       
        public Global.TableStatus Status { get; set; }  
       
        public ButtonEx()
        {
            InitializeComponent();
            this.Image = global::coffeeshop.Properties.Resources.available;
            this.Size = new System.Drawing.Size(55, 55);
            this.Text = "";
            //this.Click += click;
            //this.MouseEnter += mouseEnter;
                      
        }

        public void resetButton()
        {
            switch (Status)
            {
                case Global.TableStatus.Available:
                    this.Image = global::coffeeshop.Properties.Resources.available;
                    break;
                case Global.TableStatus.Servicing:
                    this.Image = global::coffeeshop.Properties.Resources.servicing;
                    break;
                case Global.TableStatus.Billed:
                    this.Image = global::coffeeshop.Properties.Resources.Billed;
                    break;
                case Global.TableStatus.Changed:
                    this.Image = global::coffeeshop.Properties.Resources.Changed;
                    break;
                default:
                    this.Image = global::coffeeshop.Properties.Resources.available;
                    break;
            }
            this.Visible = isVisible;
            this.Text = "";
        }

        
        //private void mouseEnter(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        ToolTip tt = new ToolTip();

        //        tt.ToolTipTitle = mv_Resources.GetString("BUTTONEXTTTITLE");
        //        tt.UseFading = true;
        //        tt.UseAnimation = true;
        //        tt.ShowAlways = true;
        //        tt.IsBalloon = true;                
                
        //        switch (Status)
        //        {
        //            case (int)Global.TableStatus.Available:
        //                tt.SetToolTip(this, mv_Resources.GetString("TABLEAVAILABLE"));
        //                break;
        //            case (int)Global.TableStatus.Servicing:
        //                tt.SetToolTip(this, mv_Resources.GetString("TABLESERVICING"));
        //                break;
        //            case (int)Global.TableStatus.Billed:
        //                tt.SetToolTip(this, mv_Resources.GetString("TABLEBILLED"));
        //                break;
        //            case (int)Global.TableStatus.Changed:
        //                tt.SetToolTip(this, mv_Resources.GetString("TABLECHANGED"));
        //                break;
        //            default:
        //                tt.SetToolTip(this, mv_Resources.GetString("TABLEUNKNOW"));
        //                break;
        //        }               
        //    }
        //    catch (Exception ex)
        //    {                
        //        MessageBox.Show("Error: " + ex.Message);
        //    }           

        //}
    }
}
